raogkfandomcom-20200214-history
Help:Navigation for multi-page areas
Introduction Many of the states and countries covered by this wiki would have pages that were awkwardly long if every offer related to the area had to be on the same page. So the wiki founder has split them up, and more splits may be made. For a few, the separate pages may have names of provinces or states, but for most there is just a number, e.g. "Ohio2". Navigating to other pages for the same area When you are looking at one of those pages and want to go quickly to another page for the same area, you want a navigation paragraph that links you to the target page with a description. That paragraph can be created with laborious copying and pasting, as has been done, but the process would have to be repeated for every appearance on every page if there were ever a change, e.g. further splitting of pages when one got too big. Templates Templates are the answer. Every page for the state or country can have two or three copies of a simple template added to it, displaying links to every page that covers any of the area, and they are automatically updated with just amendments to a single page - the template. Example Type on a page and you get this: How it is coded This is a tidied-up version, to make the structure clearer, but the spaces in front of most of the lines are done by markup language trickery that can't be displayed easily 'Jump to: Pennsylvania "ALL" and counties A Pennsylvania counties B Pennsylvania counties C thru E Pennsylvania counties F thru L Pennsylvania counties M thru P Pennsylvania counties Q thru Z ' How to create more templates U.S. states Some states already have a page or more than one with the new-style links (containing the state name and the word "counties") based on a template like the one above; they can have their other pages easily updated using their templates (as described in the very last paragraph of this USA section). Find a state that has none of the new links. #In another window or tab, open http://raogk.wikia.com/wiki/Template:Pennsylvania_navigation?action=edit (which looks very like the above but less tidy) and copy to your clipboard the complete contents of the edit box. #In another window or tab, open the edit box for any state page that needs a new template, and go to the bottom. #Paste the block of template code that you have just copied, starting in a new line just below the existing block of code that looks similar though a little shorter. If the state has only five pages, delete the "Pennsylvania6" section (up to and including the "Z]]" and the four "&nb..." code things that precede it; if the state has four or fewer pages, delete another line or two or more above that, as necessary. #Below that code, in a new line, paste #Replace "Pennsylvania" with the state name in 13 (or 11 or 9 or whatever you left after deleting some) places, leaving the numbers "2", "3", etc, because they are part of each page name. #Change the page descriptions - the sections with "counties" in them - to suit, copying from the old code which you see above your new one. #Now you have created a link to the state navigation template (the bottom pasted line) and the full code for it (everything else). Copy it - i.e. all except the bottom line, which is the template you will leave in place. #Preview the page and scroll to the bottom. Below your links with "counties" in their names, you will see a red link like "Template:statename navigation" . Open that in a new window or tab and paste your new code in. Preview that, and if it looks about right you should Publish it. It should then display some extra documentation below the county links, but never mind if it doesn't. That and other tweaks can be done later. #Go back to your state page preview, hit "back", then hit "Preview" again: that red link should have been replaced by yet another set of links to other pages for that state! #If it has, go "back" to the edit box again; all that you now need to do is delete the old block of code and the new one that you copied and pasted and modified and pasted elsewhere. Further up the page and on all other pages for the state, you can replace any other instance of the old code with the simple template. Copy the template and paste it in, to replace any old navigation links code for the state. Other countries Follow the above procedure with appropriate modifications. Possibly better model code will be found at either *http://raogk.wikia.com/wiki/Template:Australia_navigation?action=edit or *http://raogk.wikia.com/wiki/Template:Canada_navigation?action=edit *Help